package com.example.demo.controller;

import com.example.demo.ao.OAspAo;
import com.example.demo.service.OAspService;
import com.example.demo.vo.OAspVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/application")
public class OAspController {

    @Autowired
    private OAspService oaspService;

    @PostMapping("start/application")
    public int insertApplication(@RequestBody OAspAo oAspAo){
        return oaspService.insertApplication(oAspAo);
    }

    @PostMapping("select/application")
    public List<OAspVo> selectApplication(@RequestBody OAspAo oAspAo){
        return oaspService.selectAllApplication(oAspAo);
    }
}
